package cn.gdpu.course.dao.impl;

import cn.gdpu.course.dao.MybatisDao;
import cn.gdpu.course.dao.TeacherDao;
import cn.gdpu.course.dao.domain.Teacher;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2018/3/13.
 */
@Repository
public class TeacherDaoImpl extends MybatisDao<Teacher> implements TeacherDao {
	public boolean save(Teacher bean) {
		return this.insert("TeacherMapper.insert", bean);
	}

	public boolean update(Teacher bean) {
		return this.insert("TeacherMapper.update", bean);
	}

	public boolean delete(Teacher bean) {
		return this.insert("TeacherMapper.delete", bean);
	}

	public List<Teacher> find(Teacher bean) {
		return this.queryForList("TeacherMapper.select", bean);
	}

	public Teacher findById(Teacher bean) {
		return this.queryForObject("TeacherMapper.selectById", bean);
	}

	public Teacher findByTno(Teacher bean) {
		return this.queryForObject("TeacherMapper.selectByTno", bean);
	}

	public Teacher findByTname(Teacher bean) {
		return this.queryForObject("StudentMapper.selectByTname", bean);
	}
}
